<template>
  <!-- 标题 -->
  <!-- <div class="top">
     <div class="top-image">
       <img src="../../../image/login-logo-2.png" alt="">
     </div>
  </div> -->

  <!-- 轮播图大盒子 -->
  <div class="Carousel">
    <!-- 左侧盒子 -->
     <div class="Carousel-left">
        <div class="item">
          <div class="somall"></div>
          <a href="##">家电 数码 手机</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">女装 男装 穿搭</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">家具 家饰 家纺</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">运动 户外 乐器</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">游戏 动漫 影视</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">工具 装修 建材</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">美妆 清洁 宠物</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">鞋靴 箱包 配件</a>
        </div>
        <div class="item">
          <div class="somall"></div>
          <a href="##">玩具 孕产 用品</a>
        </div>
     </div>
    <!--  右侧盒子-->
     <div class="Carousel-right">
        <el-carousel height="447px">
           <el-carousel-item v-for="(item, index) in datas.carousels" :key="index">
               <img :src="item.carouselUrl" alt="">
           </el-carousel-item>
        </el-carousel>
     </div>
  </div>

  <!-- 底部手机 -->
  <div class="hotGoodses">
    <div class="hot-image" v-for="(item, index) in datas.hotGoodses" :key="index">
       <img :src="item.goodsCoverImg" alt="">
    </div>
  </div>
</template>

<script setup>
   import axios from 'axios'
   import { onMounted, ref } from 'vue'
   const datas = ref([])
   async function getList() {
     const {data} = await axios.get('/api/homeinfo')
     datas.value = data.data
   }
   onMounted(() => {
    getList()
   })
</script>

<style scoped lang="scss">
*{
    margin: 0;
    padding: 0%;
}
.top{
  width: 100%;
  height: 100px;
    .top-image{
      width: 240px;
      height: 100px;
      img{
        width: 100%;
      }
    }
}
.Carousel{
  display: flex;
  width: 100%;
  height: 447px;
  background-color: aquamarine;
  .Carousel-left{
    width: 228px;
    height: 447px;
    background-color: rgb(53, 50, 50);
    .item{
      height: 49px;
      border-bottom: 1px solid white;
      line-height: 49px;
      display: flex;
      padding-left: 25px;
      a{
        text-decoration: none;
        color: aliceblue;
      }
      a:hover {
         color: #27BA9B;
      }
      .somall{
        width: 8px;
        height: 8px;
        background-color: #fff;
        margin-top: 21px;
        border-radius: 4px;
        margin-right: 10px;
      }
    }
  }
  .Carousel-right{
    width: 1012px;
    height: 447px;
    background-color: #fff;
    img{
      width: 100%;
      height: 100%;
    }
  }
}
.hotGoodses{
  width: 100%;
  height: 295px;
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  .hot-image{
    width: 295px;
    height: 295px;
    background-color: #fff;
    img{
      width: 100%;
      height: 100%;
      opacity: 0.8;
    }
    img:hover{
      opacity: 1;
    }
  }
}
</style>